#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<vector>
using namespace std;

class Solution {
public:
	vector<vector<int>> generate(int numRows)
	{
		vector<vector<int>> vv;
		vector <int> v;
		vv.resize(numRows,v);
		for (int vi = 0; vi<numRows; ++vi)
		{
			vv[vi].resize(vi + 1, 0);
			vv[vi][0] = vv[vi][vi] = 1;
		}

		for (int i = 2; i<numRows; ++i)
		{
			for (int j = 0; j<vv[i].size() - 1; j++)
			{
				if (vv[i][j] == 0)
					vv[i][j] = vv[i - 1][j - 1] + vv[i - 1][j];
			}
		}
		return vv;
	}
};





int main()
{
	Solution S;
	S.generate(5);
	//cout << S.generate() << endl;
	return 0;
}
